from enum import Enum, unique


class AppProduct:

    Hearty = '1490743162'
    HeartyPro = '1510748456'
    Sub_Hearty_1_Year = '6449180970'
    Water_Now = '1566509843'
    iHeart = '1543696428'
    Sub_Hearty_1_Month = '6470372096'
    Hearty_Premium_Version = '1497448251'
    Health_Watcher = '1548942501'
    Water_Premium_Version = '1598771532'
    Sub_Pulse_1_Year = '6449211326'
    Sub_Pulse_1_Month = '6470376652'
    Sub_Pulse_3_Months = '6449211209'
    Pulse_Premium_Permanent = '6449211820'
    Sub_Hearty_1_Week = '6470877299'
    Sub_Pulse_1_Week = '6470877825'
    Sub_Hearty_3_Months = '6449179277'
    Sub_Hearty_1_Year_2 = '6471039267'
    

    __apple_products = [
        ('1490743162', 'gzheart.gztech', 'Hearty', None),
        ('1510748456', 'gzheartproapp.gztech', 'HeartyPro', None),
        ('6449180970', 'premium1year.gzheart.gztech', 'Sub Hearty 1 Year', '1490743162'),
        ('1566509843', 'gztech.WaterReminder', 'Water Now', None),
        ('1543696428', 'gztech.PulseDetector', 'iHeart', None),
        ('6470372096', 'premium1month.gzheart.gztech', 'Sub Hearty 1 Month', '1490743162'),
        ('1497448251', 'pro.gzheart.gztech', 'Hearty Premium Version', '1490743162'),
        ('1548942501', 'stress.gztech', 'Health Watcher', None),
        ('1598771532', 'gztech.WaterReminder.FullVersion', 'Water Premium Version', '1566509843'),
        ('6449211326', 'premium1year.gztech.PulseDetector', 'Sub Pulse 1 Year', '1543696428'),
        ('6470376652', 'premium1month.gztech.PulseDetector', 'Sub Pulse 1 Month', '1543696428'),
        ('6449211209', 'premium3months.gztech.PulseDetector', 'Sub Pulse 3 Months', '1543696428'),
        ('6449211820', 'premiumpermanent.gztech.PulseDetector', 'Pulse Premium Permanent', '1543696428'),
        ('6470877299', 'premium1week.gzheart.gztech', 'Sub Hearty 1 Week', '1490743162'),
        ('6470877825', 'premium1week.gztech.PulseDetector', 'Sub Pulse 1 Week', '1543696428'),
        ('6449179277', 'premium3Months.gzheart.gztech', 'Sub Hearty 3 Months', '1490743162'),
        ('6471039267', 'premium1year2.gzheart.gztech', 'Sub Hearty 1 Yeart_2', '1490743162'),
    ]
    
    @classmethod
    def has_value(cls, value):
        for product in cls.__apple_products:
            if product[0] == value or product[1] == value or product[2] == value:
                return True
        
        return False
    
    @classmethod
    def get_product_name_by_id(cls, value):
        for product in cls.__apple_products:
            if product[0] == value:
                return product[2]
            
    @classmethod
    def get_product_sku_by_id(cls, value):
        for product in cls.__apple_products:
            if product[0] == value:
                return product[1]
            
    @classmethod
    def get_product_id_by_sku(cls, sku:str):
        for product in cls.__apple_products:
            if product[1] == sku:
                return product[0]
            
    @classmethod
    def get_parent_apple_id(cls, id:str):
        for product in cls.__apple_products:
            if product[0] == id:
                return product[3]
            
    @classmethod
    def get_child_product_ids(cls, id:str):
        child_ids = []
        for product in cls.__apple_products:
            if product[3] == id:
                child_ids.append(product[0])
        
        return child_ids